<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>10-a标签阻止默认行为</title>
	</head>
	<body>
		<a href="http://www.baidu.com">百度</a>
		<script type="text/javascript">
			document.querySelector('a').onclick=function(e){
				
				alert('123');
				//设置属性值
				//this.href="#";
				//return false;
				e.preventDefault();
			}
		</script>
	</body>
</html>
